import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import channelview from '../views/channelView.vue'
import videoview from '../views/videoView.vue'

const router = createRouter({
  mode:'history',
  history: createWebHistory(import.meta.env.BASE_URL),
  
  routes: [
    {
      path:'/',
      redirect:'/home'
    },
    {
      path: '/home',
      component: () => import("../views/HomeView.vue"),
      
    },
    {
      path: '/channel',
      component: channelview
    },
    {
      path:'/video',
      component: videoview
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')
    },
    
  ]
})

export default router

